package sy.cxf.webservice;

import org.apache.cxf.endpoint.Client;
import org.apache.cxf.jaxws.endpoint.dynamic.JaxWsDynamicClientFactory;

public class CallService {

	public static String callService() {
	
		try {	
			JaxWsDynamicClientFactory dcf = JaxWsDynamicClientFactory.newInstance();
			Client client = dcf
					.createClient("http://localhost:8080/sshe/ws/webServiceDemo?wsdl");
			Object[] res = null;
			res = client.invoke("helloWs");
			return (String) res[0];
		} catch (Exception e) {
			e.printStackTrace();
		}
		return null;
	}

}
